#ifndef LTIME_ORZ
#define LTIME_ORZ

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int L_localtime(char* date,size_t maxSize = 0)
{
	time_t now = time(NULL);
	struct tm* now_tm = localtime(&now);
	char tmp[1024]  = {0};
	sprintf_s(tmp,sizeof(tmp),"%04d-%02d-%02d %02d:%02d:%02d",
		now_tm->tm_year	+ 1900,
		now_tm->tm_mon	+ 1,
		now_tm->tm_mday,
		now_tm->tm_hour,
		now_tm->tm_min,
		now_tm->tm_sec);

	size_t len = strlen(tmp);
	if(maxSize > 0 && len > maxSize)
		return (int)len;

	memcpy(date,tmp,len);
	return 0;
}


#endif




